#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //设置随机数种子，使用时间戳作为随机种子
    srand(time(0));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_no_pressed()
{
    int wigth=this->geometry().width();
    int height=this->geometry().height();


    int x=rand()% wigth;
    int y=rand()%height;

    ui->no->move(x,y);

}
